export class Page<T> {
  data: any;
  // data: Array<T>;
  pageNumber?: number;
  pageSize?: number;
  pageCount?: number;
  total?: number;
  code?: number;

  constructor(
    data: any,
    // data: Array<T>,
    pageNumber?: number,
    pageSize?: number,
    total?: number,
    code?: number,
  ) {
    this.pageNumber = pageNumber;
    this.pageSize = pageSize;
    this.total = total;
    this.data = data;
    this.code = code || 200;
    // this.pageCount = Math.ceil(total / pageSize);
  }
}

export class results<T> {
  data: any;
  message?: string;
  code?: number;
  constructor(
    data: any,
    message?: string,
    code?: number | null,
  ) {
    this.data = data ? data : null;
    this.message = message || "OK";
    this.code = code || 200;
  }
}

export class Err<T> {
  data: null;
  message?: string;
  code?: number;
  errors?: any;
  constructor(
    message?: string,
    code?: number | null,
    errors?: any,
  ) {
    this.data = null;
    this.message = message;
    this.code = code || 404;
    this.errors = errors;
  }
}